(function() {
    (function() {
        "use strict";
        function a(d) {
            console.log("boot channel:", d), b++;
            var e = window._CCSettings;
            if (!e.debug) {
                var f = e.uuids, g = e.rawAssets, h = e.assetTypes, k = e.rawAssets = {};
                for (var l in g) {
                    var m = g[l], n = k[l] = {};
                    for (var o in m) {
                        var p = m[o], q = p[1];
                        "number" == typeof q && (p[1] = h[q]), n[f[o] || o] = p;
                    }
                }
                for (var r, s = e.scenes, t = 0; t < s.length; ++t) r = s[t], "number" == typeof r.uuid && (r.uuid = f[r.uuid]);
                var i = e.packedAssets;
                for (var u in i) for (var v = i[u], w = 0; w < v.length; ++w) "number" == typeof v[w] && (v[w] = f[v[w]]);
            }
            var j;
            cc.sys.isBrowser && (j = document.getElementById("GameCanvas"));
            var x = e.jsList, y = e.debug ? "src/project.dev.js" : "src/project.85a22.js";
            x ? (x = x.map(function(a) {
                return "src/" + a;
            }), x.push(y)) : x = [ y ], cc.sys.isNative && cc.sys.isMobile && (x = x.concat([ "src/anysdk/jsb_anysdk.js", "src/anysdk/jsb_anysdk_constants.js" ]));
            var z = {
                width: 1280,
                height: 720,
                id: "GameCanvas",
                scenes: e.scenes,
                debugMode: e.debug ? cc.DebugMode.INFO : cc.DebugMode.ERROR,
                showFPS: !1,
                frameRate: 60,
                jsList: x,
                groupList: e.groupList,
                collisionMatrix: e.collisionMatrix,
                renderMode: 0
            };
            cc.game.run(z, function() {
                cc.view.resizeWithBrowserSize(!0), !1, cc.AssetLibrary.init({
                    libraryPath: "res/import",
                    rawAssetsBase: "res/raw-",
                    rawAssets: e.rawAssets,
                    packedAssets: e.packedAssets,
                    md5AssetsMap: e.md5AssetsMap
                });
                var d = e.launchScene;
                c || wx.onNetworkStatusChange(function(d) {
                    c = !0;
                    var e = cc.director.getScene();
                    if (console.log("onNetworkStatusChange:", d.isConnected, d.networkType), !(e && "homeScene" != e.name)) {
                        let c = d.isConnected;
                        c ? (b = 0, a()) : wx.showModal({
                            title: "提示",
                            content: "当前网络错误，请切换网络",
                            showCancel: !1,
                            confirmText: "确定",
                            success: function() {}
                        });
                    }
                });
                var f = !1;
                cc.director.loadScene(d, function() {
                    if (f) console.log("main boot -- OK"), b = 0; else {
                        console.log("main boot ---ERROR");
                        let c = "重新加载", d = a;
                        2 < b && (c = "退出游戏", d = function() {
                            wx.exitMiniProgram({
                                success: function() {
                                    console.log("exitMiniProgram success");
                                },
                                fail: function() {
                                    console.log("openSexitMiniProgrametting fail");
                                }
                            });
                        }), wx.showModal({
                            title: "网络错误(●'◡'●)",
                            content: "加载场景资源出错，请切换网络重试。",
                            showCancel: !1,
                            confirmText: c,
                            success: function(a) {
                                a.confirm && d();
                            }
                        });
                    }
                }, function() {
                    if (f = !0, cc.sys.isBrowser) {
                        j.style.visibility = "";
                        var a = document.getElementById("GameDiv");
                        a && (a.style.backgroundImage = "");
                    }
                    cc.loader.onProgress = null, console.log("Success to load scene: " + d);
                });
            });
        }
        var b = 0, c = !1;
        if (window.jsb) require("src/settings.8b35c.js"), require("src/jsb_polyfill.js"), 
        a(1); else {
            require(window._CCSettings.debug ? "cocos2d-js.js" : "cocos2d-js-min.be00d.js");
            var d = cc.loader.md5Pipe || cc.loader.assetLoader;
            cc.loader.insertPipeAfter(d, wxDownloader), a(2);
        }
    })();
})();